From 9cc4ea633f930ea636b503b27f0006f3dc8f5109 Mon Sep 17 00:00:00 2001 From: robertl Date: Mon, 9 May 2005 16:25:33 +0000 Subject: [PATCH] From Olaf: Let IGC round when doing FP->int conversions. Regenerate IGC reference to minimize rounding differences. --- gpsbabel/igc.c | 4 ++-- gpsbabel/reference/igc1_3d.out | 2 +- gpsbabel/reference/igc1_gpx.out | 2 +- gpsbabel/reference/igc1_igc.out | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/gpsbabel/igc.c b/gpsbabel/igc.c index 33c1f2273..188e7d378 100644 --- a/gpsbabel/igc.c +++ b/gpsbabel/igc.c @@ -518,8 +518,8 @@ static char *latlon2str(const waypoint * wpt) char lon_hemi = wpt->longitude < 0 ? 'W' : 'E'; unsigned char lat_deg = fabs(wpt->latitude); unsigned char lon_deg = fabs(wpt->longitude); - unsigned int lat_min = rint((fabs(wpt->latitude) - lat_deg) * 60000); - unsigned int lon_min = rint((fabs(wpt->longitude) - lon_deg) * 60000); + unsigned int lat_min = (fabs(wpt->latitude) - lat_deg) * 60000 + 0.500000000001; + unsigned int lon_min = (fabs(wpt->longitude) - lon_deg) * 60000 + 0.500000000001; if (snprintf(str, 18, "%02u%05u%c%03u%05u%c", lat_deg, lat_min, lat_hemi, lon_deg, lon_min, lon_hemi) != 17) { diff --git a/gpsbabel/reference/igc1_3d.out b/gpsbabel/reference/igc1_3d.out index 21ff7744a..2ecdeb4e2 100644 --- a/gpsbabel/reference/igc1_3d.out +++ b/gpsbabel/reference/igc1_3d.out @@ -48,7 +48,7 @@ B0419123040526S15036253EA0090600000 B0419433040646S15036334EA0090300000 B0420133040794S15036367EA0089500000 B0420443040707S15036367EA0090300000 -B0421143040678S15036423EA0092200000 +B0421143040679S15036423EA0092200000 B0421443040658S15036414EA0091400000 B0422153040772S15036358EA0091900000 B0422453040722S15036423EA0096100000 diff --git a/gpsbabel/reference/igc1_gpx.out b/gpsbabel/reference/igc1_gpx.out index c88087656..25c86bb95 100644 --- a/gpsbabel/reference/igc1_gpx.out +++ b/gpsbabel/reference/igc1_gpx.out @@ -157,7 +157,7 @@ xsi:schemaLocation="http://www.topografix.com/GPX/1/0 http://www.topografix.com/ - + diff --git a/gpsbabel/reference/igc1_igc.out b/gpsbabel/reference/igc1_igc.out index beb86d8e2..9d3c0071e 100644 --- a/gpsbabel/reference/igc1_igc.out +++ b/gpsbabel/reference/igc1_igc.out @@ -48,7 +48,7 @@ B0419123040526S15036253EA0000000000 B0419433040646S15036334EA0000000000 B0420133040794S15036367EA0000000000 B0420443040707S15036367EA0000000000 -B0421143040678S15036423EA0000000000 +B0421143040679S15036423EA0000000000 B0421443040658S15036414EA0000000000 B0422153040772S15036358EA0000000000 B0422453040722S15036423EA0000000000 -- 2.30.2